﻿//===================================================================================
// Copyright (c) Ryan Garrett.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================

using System;
using Caffeine.Core.Test.TestModel.PropertyRegistrations;

namespace Caffeine.Core.Test.TestModel
{
    public class ModelForPropertyTestingB : ModelBase
    {
        private readonly ModelProperty<Int32> _int32Property;
        private readonly ModelProperty<Nullable<Decimal>> _nullableDecimalProperty;
        private readonly ModelProperty<EnumForTesting> _enumProperty;
        private readonly ModelProperty<Nullable<EnumForTesting>> _nullableEnumProperty;
        private readonly ModelProperty<String> _stringProperty;
        private readonly ModelProperty<ModelWithNoProperties> _childModelProperty;
        private readonly ModelProperty<Object> _unconstrainedProperty;

        public ModelForPropertyTestingB()
        {
            _int32Property = RegisterProperty<Int32>("Int32Property");
            _nullableDecimalProperty = RegisterProperty<Nullable<Decimal>>("NullableDecimalProperty");
            _enumProperty = RegisterProperty<EnumForTesting>("EnumProperty");
            _nullableEnumProperty = RegisterProperty<Nullable<EnumForTesting>>("NullableEnumProperty");
            _stringProperty = RegisterProperty<String>("StringProperty");
            _childModelProperty = RegisterProperty<ModelWithNoProperties>("ChildModelProperty");
            _unconstrainedProperty = RegisterProperty<Object>("UnconstrainedProperty");
            ValidateRegisteredProperties();
        }

        public ModelProperty<Int32> Int32Property
        {
            get
            {
                return _int32Property;
            }
        }

        public ModelProperty<Nullable<Decimal>> NullableDecimalProperty
        {
            get
            {
                return _nullableDecimalProperty;
            }
        }

        public ModelProperty<EnumForTesting> EnumProperty
        {
            get
            {
                return _enumProperty;
            }
        }

        public ModelProperty<Nullable<EnumForTesting>> NullableEnumProperty
        {
            get
            {
                return _nullableEnumProperty;
            }
        }

        public ModelProperty<String> StringProperty
        {
            get
            {
                return _stringProperty;
            }
        }

        public ModelProperty<ModelWithNoProperties> ChildModelProperty
        {
            get
            {
                return _childModelProperty;
            }
        }

        public ModelProperty<Object> UnconstrainedProperty
        {
            get
            {
                return _unconstrainedProperty;
            }
        } 
    }
}
